﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace BLL
{
    public class ClothCompanyBLL
    {
        private readonly DAL.ClothCompanyDAL clothcompanydal = new DAL.ClothCompanyDAL();
        
        /// <summary>
        /// 获取所有active=1的布料公司
        /// </summary>
        /// <returns></returns>
        public DataTable getActiveCompany()
        {
            return clothcompanydal.getAllCompany(false);
        }
        /// <summary>
        /// 根据布料公司名获取邮箱地址 
        /// </summary>
        public string getEmailAddress(string companyName)
        {
            DataTable dt=clothcompanydal.getCompanyByName(companyName);
            if (dt.Rows.Count > 0)
            {
                return "vinlon@albon.com.hk";
            }
            else
            {
                return "Can not find the company!";
            }
        }
    }
}
